package recursion;

//采用递归的方式，计算1-100的和
public class Test1 {
    public static void main(String[] args) {
        System.out.println(getSum(1));
    }

    public static int getSum(int number){
        int sum = 0;
        if(number == 100){
            return number;
        }
        sum = number + getSum(number + 1);
        return sum;
    }
}
